﻿@using FwProject.Settlement.Dto
@using FwProject.ManagerConfig.Dto
@using FwProject.Comm
@model List<SettlementInfoPrintDto>
@{

    ConfigInfoDto config = ViewBag.Config;
}
<link href="/css/print.css" rel="stylesheet" />
<style type="text/css">
    .input-group[class*=col-] {
        padding: 0 15px;
    }

   
    .PageNext {
        page-break-after: always;
    }

    * {
        word-wrap: break-word;
        word-break: break-all;
    }

    table {
        border-collapse: collapse;
        border-spacing: 0px;
    }
</style>
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0 style="display: none"> </OBJECT>
<div align="center">
    <input type=button value="打印" class="noprint" name="Submit" onClick="pagePrint();">
    <input type=button value="打印预览" onclick="document.all.WebBrowser.ExecWB(7,1)">
    <input type=button value="去除发票格式" receipt=1 onclick="changeReceipt(this)" style="display: none;">
</div>
<form name="printformName" id="printformName" action="" method="post">
    <div align="center">
        <div id="printObj" style="width: 190mm" align="center">

            <div align="center" style="font-size: 14px; margin-top: 3px; margin-bottom: 15px; font-weight: bold;">
            </div>
        
            @foreach (var item in Model)
            {


                <table name="mainTable" style="width:100%;height:auto;text-align: center;margin-bottom:0px;margin-top:10px;" border="0">
                    <tr>
                        <td align='center' style='width:100%;display: none;'>
                            <table cellSpacing=0 cellPadding=0 style="width: 600px">
                                <tr>
                                    <td align="center" width="100%" style="font-size: 22px;color:#000000;height: 35px;padding-top: 10px;" colspan="3">
                                        @config?.CorporateName
                                    </td>
                                </tr>
                                <tr>
                                    <td nowrap="nowrap" align="right" width="50%" style="font-size: 14px;color:#000000;height: 35px">
                                        地址：@config?.CorporateAddress

                                    </td>
                                    <td nowrap="nowrap" align="right" width="50%" style="font-size: 14px;color:#000000;height: 35px">
                                        电话：@config?.CorporateMobile&nbsp;&nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" width="100%" style="font-size: 22px;color:#000000;height: 20px" colspan="3">
                                        收&nbsp;&nbsp;款&nbsp;&nbsp;收&nbsp;&nbsp;据
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="3" width="100%" style="height: 20px">
                                        @item.CreationTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;<span id='number'>@item.CreationNumber</span>
                                    </td>
                                    <td rowspan="4" align="right" style="color:#000000;font-size:12px;line-height:12px;width:5px;padding-left: 2px;">一联存根<br /><br />二联客户<br /><br />三联记账</td>
                                </tr>
                                <tr>
                                    <td align="left" colspan="2">
                                        <table name="justForJeDis" align='left' width='100%' cellSpacing=0 cellPadding=0 style='border:1px solid #000000;'>
                                            <tr>
                                                <td style='color: #000000;font-size: 16px;width: 100px;'>&nbsp;&nbsp;今&nbsp;&nbsp;收&nbsp;&nbsp;到:</td>
                                                <td align='left' style='border-bottom: 1px solid #000000;height: 35px;font-size: 14px' colspan="2">
                                                    &nbsp;@item.RestaurantInfoModel.RestaurantName&nbsp;@(item.MonthBegin)月份餐具（@item.DeliveryDate）
                                                </td>
                                            </tr>
                                            <tr>
                                                <td></td>
                                                <td colspan='2' width='500px' rowspan='2'>
                                                    @foreach (var i in item.TypeNumber)
                                                    {
                                                        <table align='left' width='500px' cellSpacing=0 cellPadding=0>

                                                            <tr>
                                                                <td nowrap width="100%" align='left' style='border-bottom: 1px solid #000000;height: 35px;font-size: 14px;'>
                                                                    @i.TypeNumberName：

                                                                    @i.DistributionBoxCount
                                                                    箱

                                                                    =&nbsp; <span name='slQuaPs'>@i.DistributionCount</span>
                                                                    套

                                                                    x&nbsp;@i.TypeNumberPrice
                                                                    =&nbsp;<span name='jeMoney'>@i.SumPrice</span>元
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    }

                                                </td>
                                            </tr>
                                            <tr>
                                                <td></td>
                                            </tr>
                                            <tr><td style='color: #000000;font-size: 16px;width: 100px;'>&nbsp;优&nbsp;惠&nbsp;金&nbsp;额&nbsp;</td><td align='left' style='border-bottom: 1px solid #000000;height: 35px;font-size: 14px' colspan='2'>@item.Discountprice &nbsp;元</td></tr>
                                            <tr>
                                                <td>
                                                    <div style='color: #000000;font-size: 16px;width: 100px;'>
                                                        &nbsp;&nbsp;金&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额<br>&nbsp;&nbsp;人&nbsp;&nbsp;民&nbsp;&nbsp;币
                                                    </div>
                                                </td>
                                                <td style='border-bottom: 1px solid #000000' colspan='2'>
                                                    <table width='100%' cellSpacing=0 cellPadding=0>
                                                        <tr>
                                                            <td align='left' style='color: #000000;font-size: 16px;width: 60px;'>(大写)</td>
                                                            <td align="left" style='font-size: 16px;'>
                                                                <span name='jeAccountUpper'> @(CapitalHelper.CmycurD(item.Totalprice))</span>&nbsp;&nbsp;&nbsp;
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style='color: #000000;font-size: 16px;width: 100px;height: 40px;'>
                                                    &nbsp;&nbsp;备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注
                                                </td>
                                                <td colspan='2'>
                                                    <table width='100%' cellSpacing=0 cellPadding=0>
                                                        <tr>
                                                            <td width='395px' style='font-size: 14px;height: 40px;' align='left'>@item.RemarksConten</td>
                                                            <td nowrap style='border-left: 1px solid #000000;font-size: 16px;height: 40px;'>
                                                                &nbsp;￥
                                                                <span width='100px' name='jeAccount'>@(item.Totalprice-item.Discountprice)</span>元
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                            </table>

                        </td>

                    </tr>
                    <tr>
                        <td align='center' style='width:100%;'>
                            <table cellSpacing=0 cellPadding=0 style="width: 600px;display: none;">
                                <tr align="left" width="100%">
                                    <td nowrap="nowrap" style="font-size: 14px;color:#000000;height: 30px;padding-right:50px;">
                                        单位盖章：

                                    </td>
                                    <td nowrap="nowrap" style="font-size: 14px;color:#000000;height: 25px;padding-right:10px;">会计：@config.Accountant</td>
                                    <td nowrap="nowrap" style="font-size: 14px;color:#000000;height: 25px;padding-right:10px;">出纳：@config.Cashier</td>
                                    <td nowrap="nowrap" style="font-size: 14px;color:#000000;height: 25px;">经手人：@config.AgentPerson</td>
                                </tr>
                            </table>

                        </td>

                    </tr>

                </table>
                <br />
                <div class="textPlan" style="" align="left">
                    <div align="center" style="border-bottom:1px black dotted;font-size: 18px;">@config?.CorporateName</div>
                    <div align="center">服务热线电话：@config?.CorporateMobile</div>
                    <div>
                        <table width="100%" style="font-size: 18px;">
                            <tr>
                                <td width="55%" style="text-align: left;font-size: 16px;white-space: nowrap;">时间范围：@item.DeliveryDate</td>
                                <td style="font-size: 16px;padding-left: 15px;white-space: nowrap;">客户：@item.RestaurantInfoModel.RestaurantName</td>

                            </tr>
                        </table>
                    </div>
                </div>
                <table width="100%" cellspacing="0" cellpadding="0" align="center" border=1 borderColor="black">
                    <tr>
                        <td width="5%" align="center"><b>序号</b></td>
                        <td width="10%" align="center"><b>货品</b></td>
                        <td width="8%" align="center"><b>配送箱数</b></td>
                        <td width="8%" align="center"><b>配送套数</b></td>
                        <td width="8%" align="center"><b>退回箱数</b></td>
                        <td width="8%" align="center"><b>退回套数</b></td>
                        <td width="8%" align="center"><b>单价(元)</b></td>
                        <td width="8%" align="center"><b>金额(元)</b></td>
                    </tr>
                    @{ int x = 1;}
                    @foreach (var y in item.TypeNumber)
                    {
                        <tr>
                            <td align="center">&nbsp;@(x++)&nbsp;</td>
                            <td align="left">&nbsp;@y.TypeNumberName&nbsp;</td>
                            <td align="right">&nbsp;@y.DistributionBoxCount&nbsp;</td>
                            <td align="right">&nbsp;@y.DistributionCount&nbsp;</td>
                            <td align="right">&nbsp;@y.BackBoxCount&nbsp;</td>
                            <td align="right">&nbsp;@y.BackCount&nbsp;</td>
                            <td align="right">
                                &nbsp;
                                @y.TypeNumberPrice&nbsp;
                            </td>
                            <td align="right">&nbsp;@y.SumPrice&nbsp;</td>
                        </tr>

                    }
                    <tr>
                        <td align="left" colspan=7>合计人民币（大写）：@(CapitalHelper.CmycurD(item.Totalprice))</td>
                        <td align="left" style="margin-left: 5px;" colspan="2">小写：￥@item.Totalprice&nbsp;</td>
                    </tr>


                </table>
                <table>
                    <tr>
                        <td style="padding: 3px;"></td>
                    </tr>
                </table>
                <table width="100%">
                    <tr>
                        <td width="30%">我方经手人签字：</td>
                        <td width="30%">请贵方财务在此签字：</td>
                        <td width="40%">
                            账单送达时间：<label style="margin-left: 40px;">年</label>
                            <label style="margin-left: 40px;">月</label>
                            <label style="margin-left: 40px;">日</label>
                        </td>
                    </tr>
                </table>
            }
        </div>
    </div>
</form>
<script src="~/js/Print.js"></script>
<script>
    var loadInfo = function () {
        //$("#printObj").css({ "width": "270mm" });
        p_init(printInit);
    };
    $(function () {
        loadInfo();
    });

    function pageSet() {
        try {
            p_pagesetup();
        } catch (e) {
            wb.execwb(8, 1);
        }
    }
    function pageView() {
        try {
            p_preview();
        } catch (e) {
            wb.execwb(7, 1);
        }
    }
    function pagePrint() {
        try {
            p_print();
        } catch (e) {
            wb.execwb(6, 6);
        }
    }
</script>

